<template>
    <div>
        <SongList :newSongData="mapSongData"></SongList>
    </div>
</template>

<script>
import SongList from '../NewSong/NewSong.vue'
export default {
    props:['searchData'],
   components:{
      SongList
   },
   computed:{
       mapSongData:function(){
           let newArr =[]
           if(this.searchData.searchResultData.length>0)
           {
             newArr= this.searchData.searchResultData.map( item=>{
                return {
                    id:item.id,
                    name:item.name,
                    picUrl:"",
                    song:{
                        album:{
                            name:item.album.name
                        },
                        artists:item.artists
                        }
                }
               })
           }
           return newArr
       }
   }
};
</script>

<style scoped>

</style>